/* pen.hh
* This file is part of ncursesxx library
* Copyright (c) 2003,2004 by Stanislav Ievlev
*
* This file is covered by the GNU Library General Public License,
* which should be included with libncursesxx as the file COPYING.
*/
#ifndef NCURSESXX_PEN_HH__
#define NCURSESXX_PEN_HH__

#include <ncurses/basic_pen.hh>
#include <ncurses/assert.hh>

namespace ncurses
{
	template <>
	struct char_traits<char> /**< specialization for the classic strings */
	{
		typedef chtype	char_type; /**< main internal character type */
		static
		void write(WINDOW *win, const char *str, int len)
		{
			::waddnstr(win, str, len);
		}
		static
		void write(WINDOW *win, const char_type ch)
		{
			::waddch(win, ch);
		}
		static
		void frame(WINDOW *win)
		{
			NCURSES_ASSERT(box(win, ACS_VLINE, ACS_HLINE));
		}
		static
		void h_line(WINDOW *win, const char_type ch, int n)
		{
			::whline(win, ch, n);
		}
		static
		void v_line(WINDOW *win, const char_type ch, int n)
		{
			::wvline(win, ch, n);
		}

	};

	template <>
	struct acs<char>
	{
		typedef char_traits<char>::char_type char_type;

		static const char_type ulcorner() { return ACS_ULCORNER; }
		static const char_type llcorner() { return ACS_LLCORNER; }
		static const char_type urcorner() { return ACS_URCORNER; }
		static const char_type lrcorner() { return ACS_LRCORNER; }
		static const char_type h_line() { return ACS_HLINE; }
		static const char_type v_line() { return ACS_VLINE; }
	};

	typedef basic_pen<char>	pen;
}
#endif
